/*
 * @Author: Aro
 * @Date: 2024-01-30 09:07:44
 */
import 'package:flutter/material.dart';
import 'package:flutter_baseui/routers/fluro_navigator.dart';
import 'package:flutter_baseui/views/router_screen/demo/model/params_back_model.dart';
import 'package:flutter_baseui/widgets/model/icon_event_model.dart';
import 'package:flutter_baseui/widgets/nav_bar_kit.dart';

class RouterParamsDemo extends StatefulWidget {
  const RouterParamsDemo({
    super.key,
    required this.userId,
  });

  final String userId;

  @override
  State<RouterParamsDemo> createState() => _RouterParamsDemoState();
}

class _RouterParamsDemoState extends State<RouterParamsDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFEDF0F2),
      body: Column(
        children: [
          NavBarKit(
            title: '路由简易参数获取',
            leftConfig: IconEventModel(
              icon: const Icon(Icons.arrow_back),
              onTap: () {
                FluroNaviagtor.goBackWithParams(
                  context,
                  const ParamsBackModel(
                    time: '2024-01-30',
                    phone: '15251046917',
                  ),
                );
              },
            ),
          ),
          Text(
            '路由传过来的参数:  ${widget.userId}',
            style: const TextStyle(fontSize: 20),
          ),
        ],
      ),
    );
  }
}
